<input type="text" value="" id="srctxt" class="app_input" style="width:200px" />
	<input type="button" value="Search" onclick="
	if($('srctxt').value!=''){
		window.location=base + '/videopodcast/searchvideo' + '/' + $('srctxt').value;
	}
	else
	{
		alert('Please enter a keyword');
	}
	" />

<br />
<?php if(!empty($data['data'])):?>
<?php App::Helper('Toolbar')->setTitle("Search Videos")->setBtnDelete()->setBtnBack()->Render(array('code'=>'videopodcast_top'));?>
<script type="text/javascript">
window.addEvent('domready', function(){
$$('.button').addEvent('click',function(){

    var button = this;
    var obj_form = this.getParent('form');

    button.set('value','Pls wait...');
    obj_form.set('send', {
	method: 'post',
	onSuccess: function(responseTxt, responseXML)
	{
            button.setStyle('display','none');
            alert(responseTxt);
	},
	onFailure: function(headerName, value){  alert('fail')}
    });
    obj_form.send(obj_form.action);
});
});
</script>
<br /><br />
<?php echo($data['links']); ?>
<table>
<tr>
<?php foreach($data['data'] as $key=>$val):?>
	<?php if($key!=0 && $key%5==0):?></tr><tr><?php endif;?>
	<td>
		<form method="post" action="<?php echo $this->baseUrl('/videopodcast/addtolist');?>" onsubmit="return false" >
		<p><?php echo($val['title']); ?></p>
		<img src="<?php echo( $val['thumbnail']); ?>" />
		<p>
			<?php echo substr($val['description'],0,50); ?><br />
			<textarea name="data[video][data]" style="display:none"><?php echo base64_encode(serialize($val)); ?></textarea>
			<input type="submit" value="Add this video" class="button" /></p>
		</form>
	</td>
<?php endforeach;?>
</tr>
</table>
<?php echo($data['links']); ?>
<?php App::Helper('Toolbar')->setBtnDelete()->setBtnBack()->Render(array('code'=>'videopodcast_bottom'));?>
<?php endif;?>